//
//  BanKaViewCell.m
//  PosApp
//
//  Created by 刘萍 on 2018/9/7.
//  Copyright © 2018年 李英新. All rights reserved.
//

#import "BanKaViewCell.h"

@implementation BanKaViewCell

- (void)setModel:(BanKaModel *)model{
    [self.BankImage sd_setImageWithURL:[NSURL URLWithString:model.bank_icon] placeholderImage:[UIImage imageNamed:@"MainZWImage"]];
    self.BankName.text = [NSString stringWithFormat:@"%@",model.bank_name];
    self.BankPerson.text = [NSString stringWithFormat:@"%@",model.bank_people];
    self.TypeLabel.text = [NSString stringWithFormat:@"%@成功，奖励合伙人",model.bank_yq];
    self.BankLabel.text = [NSString stringWithFormat:@"%@",model.bank_cash];
    
}

- (void)CreateBanKaViewCell{
    //设置阴影
    self.BKBackView.layer.cornerRadius = 8;
    self.BKBackView.layer.shadowColor = [UIColor colorWithRed:225/255.0 green:225/255.0 blue:226/255.0 alpha:1].CGColor;//shadowColor阴影颜色
    self.BKBackView.layer.shadowOffset = CGSizeMake(0,1);//shadowOffset阴影偏移,x向右偏移4，y向下偏移4，默认(0, -3),这个跟shadowRadius配合使用
    self.BKBackView.layer.shadowOpacity = 1;//阴影透明度，默认0
    self.BKBackView.layer.shadowRadius = 2;//阴影半径，默认3
    
    //设置虚线
    UIGraphicsBeginImageContext(self.LineImage.frame.size); //参数size为新创建的位图上下文的大小
    [self.LineImage.image drawInRect:CGRectMake(0, 0, self.LineImage.frame.size.width, self.LineImage.frame.size.height)];
    CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapSquare); //设置线段收尾样式
    CGFloat length[] = {4,8}; // 线的宽度，间隔宽度
    CGContextRef line = UIGraphicsGetCurrentContext(); //设置上下文
    CGContextSetStrokeColorWithColor(line, [UIColor colorWithRed:226/255.0 green:226/255.0 blue:226/255.0 alpha:1].CGColor);
    CGContextSetLineWidth(line, 2); //设置线粗细
    CGContextSetLineDash(line, 0, length, 2);//画虚线
    CGContextMoveToPoint(line, 0, 2.0); //开始画线
    CGContextAddLineToPoint(line, self.LineImage.frame.size.width, 2);//画直线
    CGContextStrokePath(line); //指定矩形线
    self.LineImage.image = UIGraphicsGetImageFromCurrentImageContext();
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

@end
